package ${dtoPackage};

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.math.BigDecimal;
import com.rems.api.req.common.BaseDTO;
import com.rems.common.model.dto.city.workflow.utils.SubtaskBaseDTO;

/**
 * <p>
 * ${table.comment!}
 * </p>
 * @author ${author}
 * @since ${date}
 */
@Data
@ApiModel(value = "${entity}AddDTO对象", description = "${table.comment!}新增")
<#if superEntityClass??>
public class ${entity}AddDTO extends ${superEntityClass} {
<#elseif entitySerialVersionUID>
public class ${entity}AddDTO <#if is_work_flow>extends SubtaskBaseDTO<#else>extends BaseDTO</#if> implements Serializable {
<#else>
public class ${entity}AddDTO {
</#if>
<#if entitySerialVersionUID>
    private static final long serialVersionUID = 1L;

</#if>
<#-- ----------  BEGIN 字段循环遍历  ---------->
<#list table.fields as field>
    <#if field.keyFlag>
        <#assign keyPropertyName="${field.propertyName}"/>
    </#if>
  <#if !field.keyFlag && field.propertyName!="gmtCreate" && field.propertyName!="gmtModified">
    /**
      * ${field.comment!''}
    */
    @ApiModelProperty(value="${field.comment!''}"<#if !field.metaInfo.nullable>,required = true</#if>)
    <#if !field.metaInfo.nullable>
        <#if field.columnType.type=="String">
    @NotBlank(message = "${field.comment!field.propertyName}不能为空")
        <#else>
    @NotNull(message = "${field.comment!field.propertyName}不能为空")
         </#if>
    </#if>
    <#if field.columnType.type=="Date">
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    </#if>
    private ${field.propertyType} ${field.propertyName};

    </#if>
</#list>
<#------------  END 字段循环遍历  ---------->
<#if !entityLombokModel>
    <#list table.fields as field>
        <#if field.propertyType == "boolean">
            <#assign getprefix="is"/>
        <#else>
            <#assign getprefix="get"/>
        </#if>
    public ${field.propertyType} ${getprefix}${field.capitalName}() {
        return ${field.propertyName};
    }


    public void set${field.capitalName}(${field.propertyType} ${field.propertyName}) {
        this.${field.propertyName} = ${field.propertyName};
    }
    </#list>
</#if>
<#if !entityLombokModel>
    @Override
    public String toString() {
        return "${entity}AddDTO{" +
    <#list table.fields as field>
         <#if !field.keyFlag>
        <#if field_index==0>
            "${field.propertyName}=" + ${field.propertyName} +
        <#else>
            ", ${field.propertyName}=" + ${field.propertyName} +
        </#if>
        </#if>
    </#list>
        "}";
    }
</#if>
}
